package com.example.eurekac;

import com.example.eurekac.entity.User;
import org.apache.commons.codec.digest.DigestUtils;

import java.io.*;

/**
 * @program: config-client
 * @description: 测试序列化
 * @author: ZhouGuoFeng
 * @create: 2018-12-07 11:45
 **/
public class testsl {
    public static void main(String[] args) throws IOException {

        //序列化对象持久化到文件夹
/*        User user=new User();
*//*        user.setUsername("zhouguofeng");
        user.setPassword("123456");*//*
        File file=new File("D:\\output.txt");
*//*        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(file));
        objectOutputStream.writeObject("string");
        objectOutputStream.writeObject(user);
        objectOutputStream.close();
        System.out.println("========================================");*//*
        ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream(file));
        String string = null;
        try {
            string = (String) objectInputStream.readObject();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        User person = null;
        try {
            person = (User) objectInputStream.readObject();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        objectInputStream.close();
        System.out.println(string + ", name: " + person.getUsername() + ", password: " + person.getPassword());*/
        //测试抽象类
//        abstractDemo abs=new clientab();
//        abs.hang();

        String tt="zhouguofeng";
        String dd= DigestUtils.sha1Hex(tt);
        System.out.println("tt:"+tt);
        System.out.println("dd:"+dd);

//        abstractDemo ff=new clientab("你还");
//        ((clientab) ff).dg(1);
    }
}
